package com.ncwu.dao;

import com.ncwu.domain.History;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * ClassName: HistoryDao
 * Package: com.ncwu.dao
 * Description:
 *
 * @Author Lidoudou
 * @Create 2025/1/8 21:23
 * @Version 1.0
 */
@Mapper
public interface HistoryDao {
    @Select("select * from tb_history")
    @Results({
            @Result(property = "historyId", column = "history_id"),
            @Result(property = "user.userId", column = "user_id"),
            @Result(property = "place.placeId", column = "place_id"),
            @Result(property = "avaliableTime.timeId", column = "time_id"),
            @Result(property = "createTime", column = "create_time")
    })
    public List<History> getAll();
}
